import React from 'react';
import {RouterProvider} from "react-router-dom";
import RouteResolve from "./RouteResolve";
import {App} from "antd";
import Hyacinth from "../global/Hyacinth";
import {useAppDispatch} from "../storage/redux/hook";

const RouterConfig = () => {
    const routeResolve = new RouteResolve();
    const router = routeResolve.resolve();
    const { message } = App.useApp();
    const dispatch = useAppDispatch();
    Hyacinth.getInstance().setMessage(message);
    Hyacinth.getInstance().setDispatch(dispatch);

    return (
        <React.Fragment>
            <RouterProvider router={router}/>
        </React.Fragment>
    );
};

export default RouterConfig;